<div style="color:violet; text-align: left; font-size: 20px">Свежие сообщения на минифорумах </div>
<br/><br/>
<?php if(!empty($lastComments)) : ?>
    <?php foreach ($lastComments as $com) : ?>
        <b> <?php echo $com['catName']; ?> </b> | 
        <span style="color: gray">
            <b><?php echo $com['name']; ?></b> 
            <?php if(!empty($com['subcats'])) : ?>
                 <?php for($i=0; $i<count($com['subcats']); $i++) : ?>
                    <span style="background-color:<?php echo Yii::app()->params['colors'][$i%10]; ?>; color:<?php echo Yii::app()->params['textColors'][$i%10]; ?>; margin-left: 10px ">
                        <?php echo CHtml::link($com['subcats'][$i]['name'], Yii::app()->createUrl('partner/default/cat', array('catId'=>$com['subcats'][$i]['catId'], 'parentId'=>$com['subcats'][$i]['parentId']))); ?>
                    </span>
                 <?php endfor; ?>
            <?php endif; ?>    
        </span>
        <br/><br/>
        <a href="<?php echo Yii::app()->createUrl('partner/forum/theme', array('catId'=>$com['catId'], 'partnerUrl'=>$com['partnerUrl'], 'url'=>$com['url'])); ?>"><?php echo $com['title']; ?></a>
        <div style="float: right">
            <span class="count_rating" style="<?php echo Yii::app()->user->IsGuest ? 'margin-right: 60px;' : ''; ?>"><?php echo $com['countComments'] ?></span> 
                <?php if(!Yii::app()->user->IsGuest) : ?>
                    <span style="color: greenyellow; margin-right: 60px;">
                        <?php echo isset($com['newCom']) ? $com['newCom'] ? ' + '.$com['newCom'] : '' : ' + '.$com['countComments']; ?>
                    </span>
                <?php endif; ?>
                
                Автор: 
                <?php if(empty($com['login'])) { ?>
                    Гость 
                <?php } else { ?>
                    <a href="<?php echo Yii::app()->createUrl('user/profile/profile', array('login'=>$com['uftlogin'])); ?>"> <?php echo !empty($com['displayName']) ? $com['displayName'] : $com['uftlogin'] ; ?> </a>
                <?php }?>
               <span style="color: gray"> <?php echo Yii::app()->dateFormatter->format("dd MMMM yyyy года в H:mm", $com['date']); ?> </span>
        </div>
        <br/><br/>
                
        <div class="well">
            <?php foreach ($com['comments'] as $c) : ?>
                <span style="color: gray"> <?php echo Yii::app()->dateFormatter->format("dd MMMM yyyy года в H:mm", $com['date']); ?> </span>
                <a href="<?php echo Yii::app()->createUrl('user/profile/profile', array('login'=>$com['uftlogin'])); ?>"> <?php echo !empty($c['displayName']) ? $c['displayName'] : $c['login']; ?> </a>
                <br/>
                <?php echo preg_replace('/\[quote([\s\S]*)\[\/quote\]/', '', $c['text']); ?>
                <br/><br/>
            <?php endforeach; ?>
            <a class="btn btn-partn" href="<?php echo Yii::app()->createUrl('partner/forum/theme', array('catId'=>$com['catId'], 'partnerUrl'=>$com['partnerUrl'], 'url'=>$com['url'])).'#form'; ?>">Ответить</a>
        </div>
    <?php endforeach; ?>
<?php endif; ?>
<div class="pages"> <?php $this->widget('CLinkPager', array('pages' => $pagination)); ?> </div>
